#pragma once
#ifndef xLine_h__
#define xLine_h__
#include "xRes.h"
#include "../../../dxhead/dxegheader.h"
#include "../../../xlib/xlib.h"

namespace Sky
{
	class xLine : public xDeviceRes<ID3DXLine*>
	{
	public:
		xLine();
		~xLine();
	protected:
		virtual TResult onCreate(xDxApp* app);
		virtual TResult onDelete(xDxApp* app);
		//xRes
		virtual TResult onCreate(xDevice* device);
		virtual TResult onReset(xDevice* device) ;
		virtual TResult onLost(xDevice* device);
		virtual TResult onDelete(xDevice* device);
	private:
		TVoid Initialise();
		TVoid Finalise();
	public:
		xLine& setColor(D3DXCOLOR color){m_Color = color; return *this;}
		xLine& setWidth(TFloat width);
		TFloat	getWidth(){return m_Width;}
		xLine& setPattern(TUint pattern);
		TResult drawLine(D3DXVECTOR2* start,D3DXVECTOR2* end );
		LPD3DXLINE getLine(){return getCreatedRes();}
	private:
		D3DXCOLOR m_Color;
		TFloat m_Width;;
		xDevice* m_Device;
	};
};
#endif // xLine_h__